﻿namespace MicroCloud.Systems.Entities
{
    /// <summary>
    /// 实体类：文件操作记录基类
    /// </summary>
    /// <typeparam name="TKey">文件记录主键类型</typeparam>
    /// <typeparam name="TFileKey">文件简介主键类型</typeparam>
    /// <typeparam name="TUserKey">用户实体主键类型</typeparam>
    public abstract class FileActionRecordBase<TKey, TFileKey, TUserKey> : EntityBase<TKey>, ICreationAudited<TUserKey>
        where TKey : struct, IEquatable<TKey>
        where TFileKey : struct, IEquatable<TFileKey>
        where TUserKey : struct, IEquatable<TUserKey>
    {
        /// <summary>
        /// 获取或设置 文件ID
        /// </summary>
        [Required]
        [DisplayName("文件ID")]
        public TFileKey FileId { get; set; }

        /// <summary>
        /// 获取或设置 记录类型
        /// </summary>
        [DisplayName("记录类型")]
        public FileActionType ActionType { get; set; }

        /// <summary>
        /// 获取或设置 文件版本
        /// </summary>
        [DisplayName("文件版本")]
        public long Version { get; set; }

        #region ICreationAudited<TUserKey>
        /// <summary>
        /// 获取或设置 创建者编号
        /// </summary>
        [DisplayName("创建者编号")]
        public TUserKey? CreatorId { get; set; }

        /// <summary>
        /// 获取或设置 创建时间
        /// </summary>
        [DisplayName("创建时间")]
        public DateTime CreatedTime { get; set; }
        #endregion
    }
}